#include<iostream>
using namespace std;
//9850
//3865
int main(){
	int n;
	cin>>n;
	int count=0;
	int o=0;
	while(1){
		if(o==0){
			if(n<600){
				count+=n/10;
				break;
			}
			else{
				count+=60;
				o=1;
				n-=600;
			}
		}
		else{
			n+=300;
			count+=60;
			o--;
		}
	}
	cout<<count;
	return 0;
}
